package com.guqj.zookeeper.lock;

import java.util.concurrent.locks.ReentrantLock;

public class DistributedReentrantLock extends DistributeLock {

	public DistributedReentrantLock(String root, String connect) {
		super(root, connect);
	}

	private ReentrantLock reentrantLock = new ReentrantLock();

	public void lock() {
		reentrantLock.lock();
		super.lock();
	}

	public boolean tryLock() {
		return reentrantLock.tryLock() && super.tryLock();
	}

	public void unLock() {
		reentrantLock.unlock();
		super.unlock();
	}

	
}
